<%@ page language="java" import="java.sql.*,com.microsoft.sqlserver.jdbc.*,java.io.*,web.rec.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"  %>



<form method="get" action="courseform.jsp">
	<table>
		<tr>
			<td>course number</td><td>grade option</td><td>consent</td><td>has lab?</td><td>dept</td><td></td>
		</tr>
		<tr>
			<td><input type="text" name="course_num" /></td>
			<td><input type="text" name="grade_option" /></td>
			<td><input type="text" name="consent" /></td>
			<td><input type="checkbox" name="has_lab" /></td>

			
			<td><select name="dept_name">
				<%  
					Connection conn = (Connection)session.getAttribute("db_conn");
					Statement stmt = conn.createStatement();
					ResultSet rs = stmt.executeQuery("SELECT dept_name FROM Department");
					while(rs.next()){  
				%>
				<option><%=rs.getString("dept_name") %></option>
				<% 
					} 
				%>
			</select></td>
			<td><input type="submit" value="insert" /></td>
			<input type="hidden" name="table" id="form_table" value="Course">
			<input type="hidden" name="action" id="form_action" value="insert">
		</tr>
	</table>
</form>


